<script setup>
import { defineProps } from 'vue'
import { useRouter } from 'vue-router'
import {isMiniProgram} from "@/utils/wx-utils.ts";

const props = defineProps({
  title: {
    required: true,
    type: [String, Number],
  },
  back: {
    required: false,
    type: Boolean,
  },
  path: String,
  newBack: {
    required: false,
    type: Boolean,
  },
})

const router = useRouter()

const goBackClick = () => {
  if (props.path || props.path === '') {
    router.push(props.path)
  } else {
    router.go(-1)
  }
}
</script>

<template>
  <div class="header">
<!--     <div @click="goBackClick" v-if="props.back " class="back">-->
<!--      <img src="@/assets/images/icons/left.png" alt="">-->
<!--    </div>-->
<!--    <div v-else class="none"></div>-->
    <h1>{{ props.title }}</h1>
    <div class="none"></div>
  </div>
</template>

<style scoped lang="scss">
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.6rem;
  padding: 0 1.2rem;
  flex-shrink: 0;
  h1 {
    font-size: 1.6rem;
    color: #333333;
    font-weight: bold;
  }
}
</style>